Data Model

Category Data model

Categories includes sub and parent category.

Parent Category Model

The parent category of parentCategoryId information is should be null.

{
  "_id": "5f081ddbd835b43b382c9bfb",
  "CreateDate": "2020-07-10T07:50:51.115Z",
  "UpdateDate": "2020-07-10T07:50:51.115Z",
  "IsActive": true,
  "AppId": "***",
  "ParentCategoryId": null,
  "Name": "sub2",
  "Icon": "string",
  "OrderIndex": 1
}

Insert Parent Category

Use InsertCategory endpoint for Add Parent Category

{
  "name": "Parent Category",
  "icon": "https://jsonplaceholder.com/category.png"
}

AppId required from route.

Sub Category Data Model

The parentcategoryId information is required for sub category.

{
  "_id": "5f081ddbd835b43b382c9bfb",
  "CreateDate": "2020-07-10T07:50:51.115Z",
  "UpdateDate": "2020-07-10T07:50:51.115Z",
  "IsActive": true,
  "AppId": "***",
  "ParentCategoryId": 5f081ddbd835b43b382c9bfc,
  "Name": "sub2",
  "Icon": "string",
  "OrderIndex": 1
}

Insert Sub Category

Use InsertSubCategory endpoint for Add Sub Category

{
  "name": "Parent Category",
  "icon": "https://jsonplaceholder.com/category.png"
}

AppId and parentCategorId required from route.

Delete Category

Use DeleteCategory endpoint for Delete Category. AppId and parentCategoryId required from route.

Note!! Category not deleted if category includes products.